using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace TestImport
{
    public partial class Testje : Form
    {
        public Testje()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String conString = Properties.Settings.Default.TestImportConnectionString;
            this.Text = conString;
            SqlConnection con = new SqlConnection(conString);
            con.Open();
            SqlCommand com = con.CreateCommand();
            String code = "1B";
            com.CommandText = "SELECT COUNT (*) FROM Leerling WHERE groepCode = "+"'"+code+"'";
            Object res = com.ExecuteScalar();
            this.Text = "Aantal leerlingen " + res;
            con.Close();

        }
    }
}